
$(function() {

	$("#mold").autocomplete(Test.mold);
	
	$("#plan").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: 'mold.php?do=Plan.ajax_id',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.id + " [" + item.piece_t + ", " + item.technics_t + ", " + item.emp_t + "]",
							value: item.id + ":" + item.emp_t
						}
					}));
				}
			});
		},
		
		minLength: 1
	});
	
	$('#date1').datepicker(_date1_option);
	$('#date1').change(function() {
		$('#date2').val($(this).val());
	});

	$('#date2').datepicker(_date1_option);

	$("#worker").autocomplete(Test.emp);
	
	$("#machine").autocomplete(Test.machine);
	
	$('#time_t').change(function() {
		var s = $(this).val();
		time(s);		
	});

	$('textarea').css("width", 400);
});